package com.oa.xinxi.dao;

import com.oa.xinxi.entity.Auth;
import org.apache.ibatis.jdbc.SQL;

public class AuthSqlProvider {

    public String insertSelective(Auth record) {
        SQL sql = new SQL();
        sql.INSERT_INTO("auth");
        
        if (record.getAuthId() != null) {
            sql.VALUES("auth_id", "#{authId,jdbcType=INTEGER}");
        }
        
        if (record.getAuthName() != null) {
            sql.VALUES("auth_name", "#{authName,jdbcType=VARCHAR}");
        }
        
        return sql.toString();
    }

    public String updateByPrimaryKeySelective(Auth record) {
        SQL sql = new SQL();
        sql.UPDATE("auth");
        
        if (record.getAuthName() != null) {
            sql.SET("auth_name = #{authName,jdbcType=VARCHAR}");
        }
        
        sql.WHERE("auth_id = #{authId,jdbcType=INTEGER}");
        
        return sql.toString();
    }
}